#ifndef FP_SETUP_H
#define FP_SETUP_H

#include <Windows.h>
#include <stdexcept>

class float_exception : public std::exception
{
public:
	virtual const char *  what() const { return "Floating-point exception\n"; }
};

class fe_denormal_operand : public float_exception 
{
public:
	virtual const char *  what() const { return "Denormal operand\n"; }
};
class fe_divide_by_zero : public float_exception 
{
public:
	virtual const char *  what() const { return "Divided by zero!\n"; }
};
class fe_inexact_result : public float_exception 
	{
public:
	virtual const char *  what() const { return "Divided by zero!\n"; }
};
class fe_invalid_operation : public float_exception
{
public:
	virtual const char *  what() const { return "Invalid operation!\n"; }
};
class fe_overflow : public float_exception 
{
public:
	virtual const char *  what() const { return "Overflow!\n"; }
};
class fe_stack_check : public float_exception
{
public:
	virtual const char *  what() const { return "Stack is full!\n"; }
};
class fe_underflow : public float_exception
{
public:
	virtual const char *  what() const { return "Underflow!\n"; }
};

void se_fe_trans_func(unsigned int ecode, struct _EXCEPTION_POINTERS*);

void enable_fp_exceptions();

#endif